@echo off
setlocal enabledelayedexpansion

set "dir_path=./input_output"
set /a count=1





:: 循环处理相对路径转换
:PROCESS_PATH
if "%dir_path:~0,1%%"=="." (
    set "dir_path=../%dir_path:~2%"
    goto :CONTINUE
)

:: 检查是否以..开头且后面还有内容
if "%dir_path:~0,2%"==".." (
    if not "%dir_path:~2%"=="" (
        set "dir_path=../%dir_path%"
        goto :PROCESS_PATH
    )
)

:CONTINUE
echo %dir_path%

cd Scripts

for /f "usebackq delims=" %%a in ("%dir_path%/search.txt") do (
    echo read line: %%a
    if !count! EQU 1 (
        start "Process_!count!" cmd /c "VTool.exe -d "%dir_path%" -t "%%a" -s"
    ) else (
        start "Process_!count!" cmd /c "VTool.exe -d "%dir_path%" -t "%%a" -s -c"
    )
    set /a count+=1
)


endlocal